package zhieasy.cn.xpu_helper.controller.course;

import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import zhieasy.cn.common.utils.StorageUtil;
import zhieasy.cn.common.vo.ResultVO;

/**
 * @author DaHang
 * @date 2020/8/1 9:31
 * 用来获取课程表上传图片token以及上传路径的controller
 */
@RequestMapping("/course/objectUpload")
@RestController("CourseObjectUploadController")
@Api(value = "/course/image" , tags = "course模块,图片处理模块")
public class CourseUploadController {
    private final StorageUtil storageUtil;

    public CourseUploadController(StorageUtil storageUtil) {
        this.storageUtil = storageUtil;
    }

    /**
     * 获取上传object的路径以及上传所需要携带的token
     */
    @RequestMapping(value = "/tokenAndUrl" , method = RequestMethod.GET)
    public ResultVO getTokenAndUrl(){
        return storageUtil.getTokenAndUrlInCourse();
    }
}
